﻿namespace Runoi.DataBase;

/// <summary>
/// 扩展支持 SqlFunc，不支持 Subqueryable
/// </summary>
public class SqlSugarTypeProvider : DefaultDynamicLinqCustomTypeProvider
{
    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="cacheCustomTypes"></param>
    public SqlSugarTypeProvider(bool cacheCustomTypes = true) : base(ParsingConfig.Default, cacheCustomTypes)
    {
    }
    /// <summary>
    /// 获取自定义类型
    /// </summary>
    /// <returns></returns>
    public override HashSet<Type> GetCustomTypes()
    {
        var customTypes = base.GetCustomTypes();
        customTypes.Add(typeof(SqlFunc));
        return customTypes;
    }
}